<?php

namespace App\Http\Controllers\Tools;

use App\Http\Common\Email;
use App\Http\Common\Globals;
use App\Http\Common\MyUtils;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

/**
 * 邮箱控制器
 * Class MailController
 * @package App\Http\Controllers\Tools
 */
class MailController extends Controller
{
    /**
     * 发送邮箱
     * @param $request
     * @return string
     */
    public function send(Request $request){
        $res = Email::getInstance()->sendMessage($request->email);
        if ($res){
            return MyUtils::dealFD('发送成功，请登录邮箱查看',1);
        }else{
            return MyUtils::dealFD(Globals::$error,-1);
        }
    }
}
